$(document).ready(function() {
    initialize()
});

function initialize() {
    	calendrier(lang);
    	$("#id_heure").clockpick();
    	// validate signup form on keyup and submit
		$("#organisation_form").validate({
			rules: {
				nom_orga: "required",
				prenom_orga: "required",
				email_orga: {
					required: true,
					email: true
				},
				date: {
					required: true,
					dateISO: true
				}
				
			}
		});
  
}

function calendrier(lang) {
    $.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
		closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
		prevText: '<Préc', prevStatus: 'Voir le mois précédent',
		nextText: 'Suiv>', nextStatus: 'Voir le mois suivant',
		currentText: 'Courant', currentStatus: 'Voir le mois courant',
		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
		'Jul','Aoû','Sep','Oct','Nov','Déc'],
		monthStatus: 'Voir un autre mois', yearStatus: 'Voir une autre année',
		weekHeader: 'Sm', weekStatus: '',
		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
		dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
		dateFormat: 'yy/mm/dd', firstDay: 0, 
		initStatus: 'Choisir la date', isRTL: false}

	$.datepicker.regional['en'] = {clearText: 'Clear', clearStatus: '',
		closeText: 'Close', closeStatus: 'Close without change',
		prevText: '<Prev', prevStatus: 'Prev month',
		nextText: 'Next>', nextStatus: 'Next month',
		currentText: 'Current', currentStatus: 'Current month',
		monthNames: ['January','Februay','March','April','May','June',
		'July','August','September','October','November','December'],
		monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun',
		'Jul','Aug','Sep','Oct','Nov','Dec'],
		monthStatus: 'Other month', yearStatus: 'Other year',
		weekHeader: 'Sm', weekStatus: '',
		dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
		dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
		dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
		dateFormat: 'yy/mm/dd', firstDay: 0, 
		initStatus: 'Pick a date', isRTL: false}

    $.datepicker.setDefaults($.datepicker.regional[lang])
    $('#id_date').datepicker()
}




    
    
    
